Set up despatch notes to send via email
This example explains how to set up the the Despatch Note (Single) layout so that you can email despatch notes to preferred customer contacts or to a delivery address contacts.
Despatch notes are automatically sent to a delivery address when one is entered on a sales order, and to a customer account address when no delivery address is entered.
You can use the Expression Editor in Report Designer to choose the email recipients of despatch notes. This enables you to choose the email recipients based on information entered on a sales order. Despatch notes have more than one header. The header used when the despatch note is printed depends on whether a delivery address has been entered on the order. You can use the complex expression in this example to send the despatch note to the email address associated with the delivery address when one is present and the customer contact when no delivery address is entered.
This example explains how to:
-
Set up a despatch note layout in Report Designer so that you can automatically email despatch notes to a delivery address contact or a specified customer contact.
- Set up a customer role and associate this role with a despatch note layout.
- Choose the customer contact that you want to send the email to.
- Send copies of your despatch notes to other recipients.
- Send despatch notes as email attachments.
- Send email messages to your Outbox first for checking.
Set up your despatch note layout in Report Designer
Open: Tools > Run Sage Report Designer.
-
Select your despatch note layout: File Explorer > Layouts.
- From the Properties Pane, select Email options and click .
-
Enter your email options:
-
From the Email message should contain: drop-down list, choose the group that matches the header section of the despatch note layout.
For the SOP despatch note (Single) layout, select the group that contains the SOPDespatchReceiptID. This can be Group 4, 5 or 6 as these are all headers for the despatch note.
-
Click To... and enter the required recipients. To send your despatch notes to your customer account contacts or delivery address contact, this must be entered as an expression.
See how to add an expression to send despatch notes to each customer contact-
In the Expressions section, click Add.
-
Drag the following from the Fields pane to the Expression Editor section:
SL Customer Accounts > ContactEmailAddress.
- Click OK.
Alternatively, you can copy and paste the following expression:
CopySLCustomerAccounts.ContactEmailAddress
See how to add an expression to send despatch notes to the delivery address on the order or to the customer contact when there is no delivery address-
In the Expressions section, click Add.
-
Enter the following expression:
(SOPOrderReturns.CustomerTypeID=0) ? SLCustomerAccounts.ContactEmailAddress :
(SOPOrderReturns.UseInvoiceAddress=0 ? SOPDocDelAddresses.EmailAddress :SLCustomerAccounts.ContactEmailAddress)
- Click OK.
Alternatively, you can copy and paste the following expression:
Copy(SOPOrderReturns.CustomerTypeID=0) ? SLCustomerAccounts.ContactEmailAddress :
( SOPOrderReturns.UseInvoiceAddress=0 ? SOPDocDelAddresses.EmailAddress :SLCustomerAccounts.ContactEmailAddress) -
-
If required, click CC... to enter the recipients for a copy of the email.
These can be entered as text or as an expression. For example, if you wanted to send the despatch note to the delivery address and a copy to the specified customer contact.
-
Enter a Subject for the email:
This can be entered as text or you can use an expression to include information such as your company name and the despatch note number.
See how to add this expression-
Click Subject.
-
Drag the following from the Fields Pane:
SYSCompanies > CompanyName.
-
In the Expression Editor, enter + " Despatch Note No " +
Note: To add more than one expression use + or and. If you want to include text with an expression use "quotation marks" around the text.
-
Drag the following from the Fields pane:
SOPDespatchReceipts > DocumentNo.
The completed expression should be as follows:
SYSCompanies.CompanyName + "Despatch Note No " + DespacthReceipts.DocumentNo
. - Click OK.
Alternatively, you can copy and paste the following expression:
CopySYSCompanies.CompanyName + " Despatch Note No:" + SOPDespatchReceipts.DocumentNo
-
-
Choose whether to send the report as plain text or as an attachment.
See how to send as plain textIf you want to send the report as plain text, you may have to amend the layout to make it suitable for an email message, as the layout is designed for printed output.
Note: Some layouts contain text that is designed to be read by a 3rd party document management add on available for Sage 200. This text is not designed to be printed but will appear when the document is sent as plain text. You may want remove this if you are sending your emails as plain text.
See how to send as an attachment- Enter the required message text.
- Choose the file type that you want to send from the Attachment Format drop-down list.
-
Enter a Filename for the attachment.
You can use an expression for this if you want the filename to include information such as your company name and the despatch note number.
See how to add this expression-
Click Filename.
-
Drag the following from the Fields Pane:
SYSCompanies > CompanyName.
- In the Expression Editor, enter + "SOPDespatchReceipts" +
-
Drag the following from the Fields pane:
SOPDespatchReceipts > DocumentNo.
The completed expression should be as follows:
SYSCompanies.CompanyName + "Despatch Note No:" + SOPInvoiceCredits.DocumentNo
. - Click OK.
Alternatively, you can copy and paste the following expression:
CopySYSCompanies.CompanyName + " Despatch Note No:" + SOPDespatchReceipts.DocumentNo
-
- Choose whether to send the despatch notes via email straight away or to your outbox for checking before sending to email recipients.
-
Choose your email account provider.
Microsoft Outlook Select this if you are using Microsoft Outlook MAPI Select this if your email application uses a MAPI (Outlook / Exchange) mail server.
-
-
To save the new despatch note layout, select File > Save As.
When you change a default layout, letter or report, you must save the new layout, letter or report in the custom or company folder.
Set up your customer contacts and delivery addresses
-
Choose to use the new order despatch layout.
-
If you want to email your despatch notes to a customer account contact, you must associate a customer role with the Sales despatch note document type.
See how to set up your customer accounts contacts-
Set up a new customer role or use an existing one.
See how to set up a new roleOpen: Accounting System Manager > Settings > Customer and Supplier Roles.
- Add a role.
- Select Sales and Use with Documents for this role.
-
Associate this role with the Sales despatch note document type.
See how to associate roles with document typesOpen: Accounting System Manager > Settings > Customer and Supplier Document Types.
- Select the role for the Sales despatch note document type.
-
Set up a Preferred Contact for the role with a valid email address for each customer account that you want to send despatch notes to via email.
See how to set up a preferred contactOpen: SL > Sales Accounts > Amend Account Details | Contacts.
- Select the contact and click Edit.
- Add or edit the role and select Preferred Contact.
-
-
If you want to send your despatch notes to the email recipient at the delivery address, make sure that you have entered an email address for each delivery address.
See how to set up a delivery addressOpen: Sales Order Processing > SOP Maintenance > Customer Delivery Addresses.
- Select the customer account.
- Edit the required delivery address and enter an email address.
Examples
Set up SOP invoices to send via email
Set up purchase orders to send via email
Set up project invoices to send via email
Set up order acknowledgements to send via email
Set up debtor letters to send via email
Other tasks
Set up customer delivery addresses
Overview